<template>
  <!-- 轮播 -->
  <view class="">
    <uv-sticky :zIndex="999" :customNavHeight="stickyTop" :offsetTop="stickyTop" bgColor="#fff">
      <view class="tab-item">
        <uv-tabs @change="tabOnChange" :current="product.activeKey" :lineColor="themConfig.theme.color" :list="product.typeList"></uv-tabs>
      </view>

      <view class="tab-item">
        <uv-tabs :scrollable="false" @change="tabStatusOnChange" :current="statusActiveKey" :lineColor="themConfig.theme.color"
                 :list="statusList"></uv-tabs>
      </view>
    </uv-sticky>

    <view v-if="product.list.length>0" class="list-item">
      <view v-for="(item,index) in product.list">
        <view class="item">
          <view class="img">
            <uv-image :src="item.images[0]" width="80px" height="80px"></uv-image>
          </view>
          <view style="width: 30rpx"></view>
          <view class="content">
            <view class="goods-desc">
              <view class="content-view" style="margin-bottom: 5px">
                <text style="font-weight: bold;">{{ item.productName }}</text>
              </view>
              <view class="integralPrice">
                <view class="price" :style="{color:themConfig.theme.color}">
                  ¥转让价：{{ item.price }}
                </view>
                <view class="status">
                  <text v-if="item.status === 'SOLD'" plain style="color: #3c9cff">已售出</text>
                  <text v-else-if="item.status === 'NORMAL'" style="color: #3c9cff">转让中</text>
                  <text v-else style="color: #5ac725">已售出</text>
                </view>
                <view class="status" style="color: #909399">
                  {{ item.time }}
                </view>
              </view>
            </view>
            <view class="operate">
              <view class="button">
                <uv-button :disabled="item.status==='SOLD'"  @click="updateProduct(item,index)" size="mini" type="primary">修改
                </uv-button>
              </view>

              <view class="button">
                <uv-button :disabled="item.status==='SOLD'" @click="saleProduct(item,index)" size="mini" type="success">已转让
                </uv-button>
              </view>

              <view class="button">
                <uv-button @click="shareCopy(item,index)" :disabled="item.status==='SOLD'"  type="primary" size="mini" class="button">
                  一键分享
                </uv-button>
              </view>

              <view @click="toDetail(item)" class="button">
                <uv-button type="primary" size="mini" class="button">详情
                </uv-button>
              </view>

            </view>
          </view>
        </view>
        <uv-gap height="10"/>
      </view>
    </view>


    <view v-else>
      <Empty :show="true"/>
    </view>


      <uv-load-more v-if="isReachBottom" @loadmore="loadmore" :status="loading.status" :loading-text="loading.loadingText"
                    :loadmore-text="loading.loadmoreText"
                    nomore-text=" "/>
      <uv-gap v-if="isReachBottom" height="5"></uv-gap>

    <FloatingBtn size="35" :iconColor="themConfig.theme.color" jumpath="/pages/school/product-idle/add/index" icon="plus" background="white" boxShadow="none"/>

  </view>
</template>
<script>
import {mixins} from './index.js'

export default {
  components: {},
  mixins: [mixins]
}
</script>
<style scoped lang="scss">
@import './index.scss';

</style>
